<?php
/**
 * Created by PhpStorm.
 * User: LG
 * Date: 2018/8/8
 * Time: 18:07
 */

namespace app\common\model;


use think\Model;

/**
 *    设备配件 模型
 * Class EquipmentsParts
 * @package app\common\model
 */
class EquipmentsParts extends Model
{
    // 表名
    protected $name = 'equipments_parts';

    // 列表查询
    public function getAll($where,$field='a.parts_id,a.parts_number,p.parts_name')
    {
        $join = [
            ['parts p', 'p.parts_id = a.parts_id', 'left']
        ];
        $result = $this->alias('a')
                    ->where($where)
                    ->join($join)
                    ->field($field)
                    ->select();
        return $result;
    }

}